<include file="public@header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:url('grade/index')}">成绩列表</a></li>
			<li><a href="{:url('grade/add')}">添加成绩</a></li>
		</ul>
        <form class="well form-inline margin-top-20" method="get" action="{:url('grade/index')}">


            学生姓名:
            <input type="text" class="form-control" name="name" style="width: 120px;" value="{$Request.param.name}" placeholder="请输入学生姓名">


            <input type="submit" class="btn btn-primary" value="搜索" />
            <a class="btn btn-danger" href="{:url('grade/index')}">清空</a>
        </form>
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th width="50">ID</th>
					<th>姓名</th>
					<th>科目</th>
					<th>成绩</th>

					<th width="140">{:lang('ACTIONS')}</th>
				</tr>
			</thead>
			<tbody>

				<foreach name="data" item="vo">
				<tr>
					<td>{$key+1}</td>
					<td>{$vo.student_name}</td>
					<td>{$vo.subject}</td>
					<td>{$vo.grade}</td>

					<td>

							<a class="btn btn-xs btn-primary" href='{:url("grade/edit",array("id"=>$vo["id"]))}'>{:lang('EDIT')}</a>
							<a class="btn btn-xs btn-danger js-ajax-delete" href="{:url('grade/delete',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>

					</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		<div class="pagination">{$page}</div>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
	<script>
		$(function () {

			$('#selectSchool').change('click',function () {

				var schoolId=$('#selectSchool').val();

				$.ajax({
					url:"{:url('grade/getSchool')}",
					type:"POST",
					data:{school_id:schoolId},
					success:function (res) {
						console.log(res);
						$('#selectRoom').html(res);
					}
				});
			});
		})
	</script>
</body>
</html>